package cn.xxc.controller;

import cn.xxc.domain.Pay;
import cn.xxc.domain.User;
import cn.xxc.feignclient.UserFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/pay")
public class PayController {
    @Autowired
    private UserFeignClient userFeignClient;
    @GetMapping("/{id}")
    public Pay getPay(@PathVariable("id")Long id ){
        User user = userFeignClient.getUser(id);
        return new Pay(id,"微信支付6000",user);
    }
}
